import BuffUtil from '@/BuffUtil';
import BuffCommon from 'code/Core/Common/BuffCommon';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
/**
 * 致命一击
 **/
export default class DZ_CriticalStrike extends AbilityBase {
    static instance: DZ_CriticalStrike;
    buffType: AppBuffType = {
        id: 'buff_DZ_CriticalStrike',
        art: this.art,
        name: this.abilityName,
        ubertip: '增加物理暴击机率',
        attribute: {
            物理暴击机率: 0.035,
        },
        stackCountMax: -1,
    };
    constructor(id: string = 'Azmj') {
        super(id);
        DZ_CriticalStrike.instance = this;
        this.init();
        this.onLevelChange(this.onLevelChangeEffect.bind(this));
        this.onRemove(this.onLevelChangeEffect.bind(this));
    }
    init() {
        BuffUtil.registerBuffType(this.buffType);
    }
    onLevelChangeEffect(p: { unit: unit; ability: DZ_CriticalStrike }) {
        let lv = this.getAbilityLevel(p.unit);
        BuffCommon.addBuff({ target: p.unit, caster: p.unit, buffTypeId: this.buffType.id, ablityId: this.id, config: { stack: lv } });
    }
}
